# 随机生成
import numpy as np

#请把快速排序算法补充完整
def quickSort(nums):
    d=len(nums)//2
    while(d>=1):
        for i in range(len(nums)//d):
            for j in range(i,len(nums)-d,d):
                if nums[j+d]<nums[j]:
                    for k in range(j+d,i,-d):
                        if nums[k]<nums[k-d]:
                            nums[k],nums[k-d]=nums[k-d],nums[k]
        d=d//2
    return nums
if __name__ == '__main__':
    nums=np.random.permutation(20)
    print(quickSort(nums))